<?php
/* [DoYouHaoBaby!] (C)Dianniu From 2010.
   this($)*/

!defined('DYHB_PATH') && exit;

class TemplateGtkGladeWidgetCompiler_GtkToggleButton extends TemplateGtkGladeWidgetCompiler_GtkButton{

	protected function compileCreateWidget_(TemplateGtkGladeWidget $oObject){
		$sCompiled=TemplateGtkGladeWidgetCompiler_GtkButton::compileCreateWidget_($oObject);
		$sVariableName='$'.TemplateGtkGlade::getWidgetVariableName($oObject);
		if($oObject->getProperty('active')){$sCompiled.= "\t\t{$sVariableName}->set_active(true);";}// 是否激活
		if($oObject->getProperty('inconsistent')){$sCompiled.= "\t\t{$sVariableName}->set_inconsistent(true);";}// 是否处于矛盾状态
		$sDrawIndicator=($sDrawIndicator=TemplateGtkGladeObj::nodeTextToValue($oObject->getProperty('draw_indicator')))?'true':'false';// 绘制指示器
		$sCompiled.="\t\t{$sVariableName}->set_mode({$sDrawIndicator});";
		return $sCompiled;
	}

	static public function regToProcessorManager(ITemplateObjProcessorManager $oManager){
		$oManager->regProcessor(str_replace('TemplateGtkGladeWidgetCompiler_','',__CLASS__),__CLASS__);
	}

}
